]> dgit.raspbian.org Git - gnome-shell.git/commitdiff
style: Use unlinked rounded buttons for notifications
authorSam Hewitt <snwh@gnome.org>
Tue, 18 Jun 2024 17:33:19 +0000 (15:03 -0230)
committerSam Hewitt <665-snwh@users.noreply.gitlab.gnome.org>
Fri, 2 Aug 2024 15:16:46 +0000 (15:16 +0000)
Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/3383>

data/theme/gnome-shell-sass/_common.scss
data/theme/gnome-shell-sass/_drawing.scss
data/theme/gnome-shell-sass/widgets/_dialogs.scss
data/theme/gnome-shell-sass/widgets/_message-list.scss
data/theme/gnome-shell-sass/widgets/_notifications.scss
js/ui/messageList.js

index 2124a3a2f0ad683489e2327a6c0126dc0b680679..1a6e687c0c6d0cdcbb7b61570856ef351f9b3d6a 100644 (file)
@@ -189,18 +189,31 @@ stage {
   }
 }
 
-// buttons in dialogs/notifications
-// lighter in color and have a greater radius
-%bubble_button {
+// buttons in notifications
+// use a rounded style and have a lighter background
+%notification_button {
+  font-weight: bold;
+  padding: $base_padding $base_padding * 2;
+  border-radius: $base_border_radius;
+
+  @include button(normal, $style: notification);
+  &:focus { @include button(focus, $style: notification);}
+  &:hover { @include button(hover, $style: notification);}
+  &:active { @include button(active, $style: notification);}
+  &:checked { @include button(checked, $style: notification);}
+  &:insensitive { @include button(insensitive, $style: notification);}
+}
+
+
+// buttons in dialogs
+// use a linked style
+%dialog_button {
   padding: $base_padding * 2;
-  font-weight: bold !important;
+  font-weight: bold;
 
   &:ltr {margin-right: 1px;}
   &:rtl {margin-left: 1px;}
 
-  // needs a 1px adjustment to fit exactly into the outer radius
-  $bubble_button_radius: $modal_radius - 1px;
-
   @include button(normal, $style: bubble);
   &:focus { @include button(focus, $style: bubble);}
   &:hover { @include button(hover, $style: bubble);}
@@ -208,26 +221,29 @@ stage {
   &:checked { @include button(checked, $style: bubble);}
   &:insensitive { @include button(insensitive, $style: bubble);}
 
+  // needs a 1px adjustment to fit exactly into the outer radius
+  $dialog_button_radius: $modal_radius - 1px;
+
   &:first-child:ltr {
-    border-radius: 0 0 0 $bubble_button_radius;
+    border-radius: 0 0 0 $dialog_button_radius;
   }
 
   &:last-child:ltr {
-    border-radius: 0 0 $bubble_button_radius;
+    border-radius: 0 0 $dialog_button_radius;
     margin-right: 0 !important;
   }
 
   &:first-child:rtl {
-    border-radius: 0 0 $bubble_button_radius;
+    border-radius: 0 0 $dialog_button_radius;
   }
 
   &:last-child:rtl {
-    border-radius: 0 0 0 $bubble_button_radius;
+    border-radius: 0 0 0 $dialog_button_radius;
     margin-left: 0 !important;
   }
 
   &:first-child:last-child {
-    border-radius: 0 0 $bubble_button_radius $bubble_button_radius;
+    border-radius: 0 0 $dialog_button_radius $dialog_button_radius;
     margin-left: 0 !important;
     margin-right: 0 !important;
   }
index 447feb6a4d8eec63bfaa17f3805586f1ae600ccc..4007e56c1acf6309fa6e96d4bde0bedb1a726743 100644 (file)
   }
 
   // background color override for buttons that use transparency
-  // styles: notification bubbles, lockscreen
+  // styles: dialogs bubbles, lockscreen
   @if $style == 'bubble' or $style == 'lockscreen' {
     $button_bg_color: transparentize($tc, .9);
     $hover_button_bg_color: transparentize($tc, .87);
     $active_hover_button_bg_color: transparentize($tc, .81);
   }
 
+  // background color overrides for notification style
+  @if $style == 'notification' {
+    $button_bg_color: transparentize($tc, .85);
+    $hover_button_bg_color: transparentize($tc, .7);
+    $insensitive_button_bg_color: transparentize($tc, .9);
+    $active_button_bg_color: transparentize($tc, .8);
+    $active_hover_button_bg_color: transparentize($tc, .8);
+  }
+
   // flat style overrides
   @if $style == 'flat' {
     $insensitive_button_bg_color: $button_bg_color;
index 2f21f9447bcd870cf4433c175be5fba27fb83929..d3adbcb1d5f94c5a807e0568431d0b0e12aeec70 100644 (file)
@@ -16,7 +16,7 @@
   }
 
   .modal-dialog-linked-button {
-    @extend %bubble_button;
+    @extend %dialog_button;
   }
 }
 
index 0fb1c8d2a4176eb577a3418a5d7aa64a985b4707..60cb5bde7307d1b2f538ab8f3394be3d18b92ef4 100644 (file)
 // message bubbles
 .message {
   @extend %card;
-  padding: 0;
+  padding: $base_padding;
   margin: 0;
   border-radius: $modal_radius;
 
-  // subtract side padding to accommodate the close button's border
-  &:ltr { padding-right:-2px; };
-  &:rtl { padding-left:-2px; };
-
   // message header
   .message-header {
-    padding: 0 $scaled_padding;
-    margin: $base_padding;
-    margin-bottom: 0;
     spacing: $base_padding;
     color: $insensitive_fg_color;
+    padding:0 $base_padding;
+
+    // side padding to accommodate the close button
+    &:ltr { padding-right:$base_padding - 2px; };
+    &:rtl { padding-left:$base_padding - 2px; };
 
     // header source icon
     .message-source-icon {
     .message-expand-button,
     .message-close-button {
       @extend .icon-button;
+      @extend %notification_button;
+      border-radius: $forced_circular_radius; // make circular
       color: $fg_color;
-      background-color: transparentize($fg_color, .9);
       padding: 4px;
-      &:hover { background-color: transparentize($fg_color, .81);}
-      &:active,
-      &:active:hover { background-color: transparentize($fg_color, .76);}
-      &:insensitive { background-color: transparentize($fg_color, .93);}
     }
 
     .message-expand-button {
-      padding: 6px;
+      padding: $base_padding;
       &:ltr { margin-right: $base_padding; }
       &:rtl { margin-left: $base_padding; }
     }
   // container for message contents
   .message-box {
     padding: $base_padding;
-    margin: $base_padding;
     margin-top: 0;
     spacing: $base_padding;
 
       }
     }
   }
+
+  // container for message buttons
+  .message-action-bin {
+    padding: $base_margin;
+    spacing: $base_padding;
+
+    // set margin on children
+    * {
+      margin: 0 $base_margin;
+      // remove margins
+      &:first-child {
+        &:ltr { margin-left:0;}
+        &:rtl { margin-right:0;}
+      }
+      &:last-child {
+        &:ltr { margin-right:0;}
+        &:rtl { margin-left:0;}
+      }
+    }
+  }
 }
 
 // URLs in messages
index 0601425ba2387c4072569ce8c3707fc2c72c05d3..d80cb62734b573e1c55875bb9265c97b307eb37d 100644 (file)
@@ -21,5 +21,5 @@ $notification_banner_width: 34em;
 }
 
 .notification-button {
-  @extend %bubble_button;
+  @extend %notification_button;
 }
index ddd5abb17ff225b88c20581bdb77e267d9776880..18b53d56907611e2ac4af5086f35e09fb385861d 100644 (file)
@@ -439,6 +439,7 @@ export const Message = GObject.registerClass({
         vbox.add_child(hbox);
 
         this._actionBin = new St.Bin({
+            style_class: 'message-action-bin',
             layout_manager: new ScaleLayout(),
             visible: false,
         });